<template>
    <fieldset>
        <legend>朋友</legend>
        <h1>王一博</h1>
        <h1>易烊千玺</h1>
        <h1>肖战</h1>
    </fieldset>
</template>
<script>
    export default {
        props:['id'],
        mounted(){
            console.log(this.$route.params);
            console.log(this.id);
        },
        watch:{
            //侦听路由参数的变化
            $route(newVal){
                console.log(newVal);
            },
            id(newVal){
                console.log('id--',newVal);
            }
        }
    }
</script>